<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
<!--
function sendFORM ( selectedtype )
{
  document.deleteP.id_prod.value = selectedtype ;
  document.deleteP.submit() ;
}
-->
</script>
</head>

<body>
<form action="borrar.php" method="post">
<input type="hidden" name="id_prod" />
<?php

	$conexion = mysql_connect("db122.1and1.es", "dbo266635413", "bN8u2JqF");
	mysql_select_db("db266635413", $conexion);

	if (!empty($_POST['id_prod']){
		//$queEmp = "DELETE FROM ibox_news WHERE id='" . $_POST['id_prod']; . "'";
		//mysql_query($queEmp, $conexion) or die(mysql_error());
		echo $_POST['id_prod'];
		echo "La noticia ha sido prensada en forma de cubo. <br>";
	}

	$queEmp = "SELECT id, title date_p FROM ibox_news ORDER BY id;";
	$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
	$totEmp = mysql_num_rows($resEmp);
	
	if ($totEmp > 0) 
	{
		while ($rowEmp = mysql_fetch_assoc($resEmp)) 
		{
			echo $rowEmp['id'] . "  " . $rowEmp['title']; ?>
            <a href="javascript: sendFORM('$rowEmp['id']')"> [x] </a><br>
            <?php
		}
	}
?>
</form>
</body>
</html>